package services;

import domain.entities.ComiteEtica;

public class CriteriaEthicsCommittee extends Criteria{

    private ComiteEtica comiteEtica;

    public CriteriaEthicsCommittee(ComiteEtica comiteEtica) {
        this.comiteEtica = comiteEtica;
    }

    @Override
    public boolean isIn(Object element){
        boolean isIn = true;
        ComiteEtica other = (ComiteEtica) element;

        isIn &= isSubstring(comiteEtica.getName(), other.getName());
        isIn &= isSubstring(comiteEtica.getAddress().getAddress(), other.getAddress().getAddress());
        isIn &= isSubstring(comiteEtica.getAddress().getCountry(), other.getAddress().getCountry());
        isIn &= isSubstring(comiteEtica.getAddress().getProvince(), other.getAddress().getProvince());
        isIn &= isSubstring(comiteEtica.getAddress().getCity(), other.getAddress().getCity());

        return isIn;
    }
}
